<template>
  <div>
    <template v-for="column in columns" :slot="column.prop" slot-scope="scope">
      <component :is="column.columnComponent" :row="scope.row" :key="column.prop"></component>
    </template>
  </div>
</template>

<script>
export default {
  name: "custom-table-columns",
  props: {
    columnsOption: {
      type: Array,
      default: () => {
        return []
      }
    }
  },
  computed: {
    columns() {
      let temp = [];
      for (let i = 0; i < this.columnsOption.length; i++) {
        let column = this.columnsOption[i];
        if (!column.columnComponent) continue
        temp.push(column);
      }
      return temp;
    }
  },
  created() {
    console.log("da", this.columns)
  }
}
</script>

<style scoped>

</style>
